package com.lcxw.hxzb.friendcircle.project.system.service.impl;

import java.util.List;

import com.lcxw.hxzb.friendcircle.common.utils.DateUtils;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdBargain;
import com.lcxw.hxzb.friendcircle.project.system.mapper.YwpdBargainMapper;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdBargainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会员砍价明细Service业务层处理
 * 
 * @author meeting
 * @date 2020-10-14
 */
@Service
public class YwpdBargainServiceImpl implements IYwpdBargainService
{
    @Autowired
    private YwpdBargainMapper ywpdBargainMapper;

    /**
     * 查询会员砍价明细
     * 
     * @param bargainId 会员砍价明细ID
     * @return 会员砍价明细
     */
    @Override
    public YwpdBargain selectYwpdBargainById(Long bargainId)
    {
        return ywpdBargainMapper.selectYwpdBargainById(bargainId);
    }

    /**
     * 查询会员砍价明细列表
     * 
     * @param ywpdBargain 会员砍价明细
     * @return 会员砍价明细
     */
    @Override
    public List<YwpdBargain> selectYwpdBargainList(YwpdBargain ywpdBargain)
    {
        return ywpdBargainMapper.selectYwpdBargainList(ywpdBargain);
    }

    /**
     * 新增会员砍价明细
     * 
     * @param ywpdBargain 会员砍价明细
     * @return 结果
     */
    @Override
    public int insertYwpdBargain(YwpdBargain ywpdBargain)
    {
        ywpdBargain.setCreateTime(DateUtils.getNowDate());
        return ywpdBargainMapper.insertYwpdBargain(ywpdBargain);
    }

    /**
     * 修改会员砍价明细
     * 
     * @param ywpdBargain 会员砍价明细
     * @return 结果
     */
    @Override
    public int updateYwpdBargain(YwpdBargain ywpdBargain)
    {
        return ywpdBargainMapper.updateYwpdBargain(ywpdBargain);
    }

    /**
     * 批量删除会员砍价明细
     * 
     * @param bargainIds 需要删除的会员砍价明细ID
     * @return 结果
     */
    @Override
    public int deleteYwpdBargainByIds(Long[] bargainIds)
    {
        return ywpdBargainMapper.deleteYwpdBargainByIds(bargainIds);
    }

    /**
     * 删除会员砍价明细信息
     * 
     * @param bargainId 会员砍价明细ID
     * @return 结果
     */
    @Override
    public int deleteYwpdBargainById(Long bargainId)
    {
        return ywpdBargainMapper.deleteYwpdBargainById(bargainId);
    }
}
